package com.cuit.dao;

import com.cuit.pojo.Doctor;
import com.cuit.pojo.DoctorOrder;
import com.cuit.pojo.DoctorOrdered;
import com.cuit.pojo.Order;

import java.util.List;

public interface OrderDao {

    //预约时，根据医生id从数据据d_order查询医生的max_order。
    public int queryByIDFromDOrder(String d_id,int day);

    //预约时，根据医生id从数据库order2-1查询医生的order_num(判断是否达到max_order)
    public int queryByIDFromOrder2(String d_id,int day);

    //病人从数据库order1对应病人的id查询其所有预约情况
    public List<Order> queryByID(String id);

    //从数据库order1中查询当前的一条预约情况
    public Order queryOneOrder(String p_id,String d_id,int day,String time);

    //添加预约情况到表order1
    public int addInfoToOrder(Order order);

    //添加预约信息到数据库order2-1 d_id,day,order_num+1
    public int saveInfoToOrder2(String doctor_id,int day);

    //病人从数据库中删除预约情况（传入医生id和day、time）
    public int deleteFromOrder1(String p_id,String d_id,String time,int day);

    //从order2_1表中，根据医生id和day,使order_num减少1
    public int updateFromOrder2(String id,int day);


    //创建一个order2的信息
    public int saveNewInfoToOrder2(String doctor_id,int day);

}
